<{include file=$module.'/header.php'}>
<div class="page add-comment" id="page-app-add-comment">
	<header class="bar bar-nav common-bar-nav">
		<a class="pull-left back"><i class="fa fa-arrow-left"></i></a>
		<h1 class="title"><{$tit}>评价</h1>
	</header>
	<{include file=$module.'/nav.php'}>
	<div class="content">
		<form id="form" >
		<input type="hidden" name="id" value="<{$info.id}>" />
		<input type="hidden" name="do" value="<{$action}>" />

		<!-- <div class="content-block-title">维修材料</div>
		<textarea name="pj_info" class="pj_info" value="" placeholder="" readonly><{$info.cl_info}></textarea>


		<div class="content-block-title  m-t-1">费用明细</div>
		<div class="list-block">
			<ul>
				<li>
					<div class="item-content">
						<div class="item-inner">
							<div class="item-title label">材料费用</div>
							<div class="item-input"><{$info.cl_money1}></div>
						</div>
					</div>
				</li>
				<li>
					<div class="item-content">
						<div class="item-inner">
							<div class="item-title label">人工费用</div>
							<div class="item-input"><{$info.cl_money2}></div>
						</div>
					</div>
				</li>
			</ul>
		</div> -->

		
		<div class="content-block-title m-t-1">评价</div>
		<div class="list-block delivery-comment">
			<ul>
				<li class="item-content">
					<div class="item-inner">
						<div class="item-title">
							维修质量
							<div class="star-comment">
								<div class="star-outline" data-name="pj_star1">
									<label>
										<input type="radio" class="radio" value="1">
										<span></span>
									</label>
									<label>
										<input type="radio" class="radio" value="2">
										<span></span>
									</label>
									<label>
										<input type="radio" class="radio" value="3">
										<span></span>
									</label>
									<label>
										<input type="radio" class="radio" value="4">
										<span></span>
									</label>
									<label>
										<input type="radio" class="radio" value="5">
										<span></span>
									</label>
								</div>
							</div>
						</div>
					</div>
				</li>
			</ul>
		</div>
		<div class="goods-comment">
			<div class="quality-comment">
				服务态度
				<div class="star-comment">
					<div class="star-outline" data-name="pj_star2">
						<label>
							<input type="radio" class="radio" value="1">
							<span></span>
						</label>
						<label>
							<input type="radio" class="radio" value="2">
							<span></span>
						</label>
						<label>
							<input type="radio" class="radio" value="3">
							<span></span>
						</label>
						<label>
							<input type="radio" class="radio" value="4">
							<span></span>
						</label>
						<label>
							<input type="radio" class="radio checked" value="5">
							<span></span>
						</label>
					</div>
				</div>
			</div>
			
		</div>

		<div class="content-block-title">评价内容</div>
		<div class="list-block">
			<ul>
				<li class="align-top">
					<div class="item-content">
						<div class="item-inner">
							<div class="item-input">
								<textarea name="pj_info" placeholder="您的建议很重要"></textarea>
							</div>
						</div>
					</div>
				</li>
			</ul>
		</div>
		
		<div class="content-padded">
			<a href="javascript:;" class="button button-fill button-big button-danger submit-com" data-id="<{$info.id}>">提交</a>
		</div>
		</form>
		<br />
	</div>
</div>

<script src="/static/app/js/qcing.js"></script>
<script>
$(function(){
	
	/*商品评价*/
	$(document).on('click', '.star-outline label', function(){
		$(this).parent().find('.radio').removeClass('checked').prop('checked', false);
		$(this).prevAll().find('.radio').prop('checked', true);
		$(this).find('.radio').addClass('checked').prop('checked', true);
	});

	$(document).on('click', '.submit-com', function(){
		var $this = $(this);
		var order_id = $this.data('id');
		if($this.hasClass('disabled')) {
			return false;
		}
		
		var params = {
			id: order_id,
			do: '<{$action}>',
			data:{}
		};
		$('.star-outline').each(function(){
			var name = $(this).data('name');
			var value = $(this).find('.radio.checked').val();
			params[name] = value;
		});
		if(!params.pj_star1) {
			$this.removeClass('disabled')
			$.toast('请评价维修服务');
			return false;
		}
		if(!params.pj_star2) {
			$this.removeClass('disabled')
			$.toast('请评价师傅服务');
			return false;
		}
		var pj_info = $.trim($('.pj_info').val());
		params.pj_info = pj_info;
		// params.data.star_wx = params.star_wx;
		// params.data.star_sf = params.star_sf;
		// params.data.order_status = <{$order_status}>;
		// var params = $('#form').serializeArray();
		$this.addClass('disabled');
		$.post("/<{$routeUrl}>/<{$action}>", params, function(response){
			if(response.code == 0){
				$this.removeClass('disabled');
				$.toast(response.msg);
				return false;
			}
			if(response.code == 1){
				$.toast(response.msg, response.url);
			}
		});
	})
});

</script>
<{include file=$module.'/footer.php'}>